package main

import (
	"encoding/json"
	"fmt"
	"math/big"
)

type TransInfo struct {
	BankCardNo  string
	CusName     string
	IdNo        string
	MobilePhone string
	Amount      big.Float
	CusNo       string
}

func main() {
	str := "{ \"BankCardNo\": \"62212346789\", \"CusName\": \"萨摩耶\", \"IdNo\": \"123456\", \"MobilePhone\": \"1300501164\", \"Amount\": \"12.00\", \"CusNo\": \"123456\" }"
	//定义实体
	var Trans TransInfo
	var Error error

	Error = json.Unmarshal([]byte(str), &Trans)
	//Trans.CusNo = "0123456"
	//Trans.Amount.SetFloat64(2.22)
	if Error != nil {
		fmt.Println(Error)
	}

	fmt.Println("json 反序列化成成功!")

	jsonStr, Error := json.Marshal(Trans)
	if Error != nil {
		fmt.Println(Error)
	}

	fmt.Println("json:", string(jsonStr))

}
